
var keys = require('./keys.js');
var RSAHelper = require('../../encrypt/RSAHelper');
var AESHelper = require('../../encrypt/AESHelper');

var decrypters = {
    0: function ( bufferIn ) {
        return bufferIn;
    },

    1: function ( bufferIn ) {
        var rsa = new RSAHelper( keys.clientPem, keys.serverPem );
        return rsa.decrypt( bufferIn );
    },

    2: function ( bufferIn ) {
        var aes = new AESHelper( keys.AESKey );
        return aes.decrypt( bufferIn );
    },

    3: function ( bufferIn ) {
        var rsa = new RSAHelper( keys.clientPem, keys.serverPem );
        return rsa.encrypt( bufferIn );
    },

    4: function ( bufferIn ) {
        var aes = new AESHelper( keys.AESKey );
        return aes.encrypt( bufferIn );
    }
};

module.exports = decrypters;